/*

 * ThumbHexaMap.java

 *

 * Created on 10. april 2002, 17:48

 */



package no.uib.jexpress_modularized.core.visualization.charts;

import java.io.Serializable;

/**

 *

 * @author  bjarte dysvik

 */

public class ThumbHexaMap extends javax.swing.JInternalFrame implements Serializable{

    public double[][][] values;
    public boolean hex=false;

    /** Creates new form ThumbHexaMap */
    public ThumbHexaMap(double[][][] values, boolean hex) {
        this.values=values;
        this.hex=hex;
        initComponents();
        hexamap1.setValues(values,hex);
        initValues();
        scaleLabel.setIcon(hexamap1.getScale());
    } 

    public void initValues(){
        boolean blueAlpha = true;
        hexamap1.setBlueAlpha(blueAlpha);
        alpha.setSelected(blueAlpha);
    }
    

    /** This method is called from within the constructor to

     * initialize the form.

     * WARNING: Do NOT modify this code. The content of this method is

     * always regenerated by the Form Editor.

     */

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jEPanel1 = new no.uib.jexpress_modularized.core.visualization.JEPanel();
        hexamap1 = new no.uib.jexpress_modularized.core.visualization.charts.hexamap();
        scalePanel = new javax.swing.JPanel();
        scaleLabel = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        alpha = new javax.swing.JCheckBox();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Variance map");

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.setLayout(new java.awt.BorderLayout());

        jEPanel1.setPaintText(false);
        jEPanel1.setLayout(new java.awt.BorderLayout());

        hexamap1.setBackground(new java.awt.Color(255, 255, 255));
        hexamap1.setLayout(new java.awt.BorderLayout());
        jEPanel1.add(hexamap1, java.awt.BorderLayout.CENTER);

        scalePanel.setBackground(new java.awt.Color(255, 255, 255));
        scalePanel.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 1, 0, 0, new java.awt.Color(0, 0, 0)));
        scalePanel.setOpaque(false);
        scalePanel.setLayout(new java.awt.BorderLayout());

        scaleLabel.setBackground(new java.awt.Color(255, 255, 255));
        scaleLabel.setOpaque(true);
        scaleLabel.setPreferredSize(new java.awt.Dimension(200, 200));
        scalePanel.add(scaleLabel, java.awt.BorderLayout.CENTER);

        jEPanel1.add(scalePanel, java.awt.BorderLayout.EAST);

        jPanel2.setOpaque(false);
        jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        alpha.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
        alpha.setSelected(true);
        alpha.setText("Clustersize as transparency");
        alpha.setActionCommand("\n");
        alpha.setOpaque(false);
        alpha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                alphaActionPerformed(evt);
            }
        });
        jPanel2.add(alpha);

        jEPanel1.add(jPanel2, java.awt.BorderLayout.SOUTH);

        jPanel1.add(jEPanel1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents



    private void alphaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_alphaActionPerformed
        hexamap1.setBlueAlpha(alpha.isSelected());
    }//GEN-LAST:event_alphaActionPerformed



    

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox alpha;
    private no.uib.jexpress_modularized.core.visualization.charts.hexamap hexamap1;
    private no.uib.jexpress_modularized.core.visualization.JEPanel jEPanel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel scaleLabel;
    private javax.swing.JPanel scalePanel;
    // End of variables declaration//GEN-END:variables

    

}

